Page({
  data: {cateItems: [
    {
     cate_id: 1,
     cate_name: "新品",
     ishaveChild: true,
     children:
     [
      {
       child_id: 1,
       name: 'BZDZLCX系列',
       image: "/imgs/BZDZLCX.png"
      },
      {
       child_id: 2,
       name: 'BZDZLLY系列',
       image: "/imgs/BZDZLCX.png"
      },
      {
       child_id: 3,
       name: 'CGLZJ系列',
       image: "/imgs/CGLZJ.png"
      },
      {
       child_id: 4,
       name: 'CHLBS系列',
       image: "/imgs/CHLBS.png"
      },
      {
        child_id: 5,
        name: 'CGLXY系列',
        image: "/imgs/CGLXY.png"
       }
     ]
    },
    {
     cate_id: 2,
     cate_name: "高端定制",
     ishaveChild: false,
     children:[]
    },
    {
     cate_id: 3,
     cate_name: "展厅现货",
     ishaveChild: false,
     children:[]
    },
    {
     cate_id: 4,
     cate_name: "客厅",
     ishaveChild: false,
     children: []
    },
    {
        cate_id: 5,
        cate_name: "卧室",
        ishaveChild: false,
        children: []
    },
    {
        cate_id: 6,
        cate_name: "书房",
        ishaveChild: false,
        children: []
    },
    {
        cate_id: 7,
        cate_name: "餐厅",
        ishaveChild: false,
        children: []
    }
   ],
   curNav: 1,
   curIndex: 0
},

//事件处理函数 
switchRightTab: function (e) {
// 获取item项的id，和数组的下标值 
let id = e.target.dataset.id,
 index = parseInt(e.target.dataset.index);
// 把点击到的某一项，设为当前index 
this.setData({
 curNav: id,
 curIndex: index
})
},

 })